<template>
  <a-modal
    :visible="cjVisible"
    centered
    title="成绩录入"
    okText='提交'
    cancelText="关闭"
    :confirmLoading="confirmLoading"
    :width="1000"
    @cancel="() => { $emit('cjCancel') }"
    @ok="onOk"
    :maskClosable="false"
    >
    <template slot="footer">
      <a-button @click="() => { $emit('cjCancel') }">关闭</a-button>
      <a-button type="primary" :loading="loading" @click="onOk()">已核对，确认提交</a-button>
    </template>
    <p>成功导入{{uploadList.length}}人</p>
    <a-table
      rowKey="index"
      :columns="columns"
      :dataSource="uploadList"
      :pagination="false"
      :scroll="{ y: 300 }">
      <span slot="serial" slot-scope="text, record, index">
        {{ index + 1 }}
      </span>
    </a-table>
  </a-modal>
</template>

<script>

export default {
  props: ['cjVisible', 'uploadList','loading'],
  data () {
    return {
      params: {},
      cjksxsmdList: [],
      confirmLoading: false,
      sortedInfo: null,
      showUnqualifiedBool:false,
      UnqualifiedList:[],
      countA:0,
      countB:0,
      countC:0,
      countD:0,
      countE:0,
      isEdit:false,
      id:"",
      // loading: false
    }
  },
  watch:{
    cjVisible(value){
      if(value){
        
      }else{
        this.loading = false
      }
    }

  },
  computed: {
    columns () {
      let { sortedInfo } = this
      sortedInfo = sortedInfo || {}
        return [
          {
            title: '序号',
            width:80,
            scopedSlots: { customRender: 'serial' }
          },
          {
            title: '学号',
            width: '170px',
            dataIndex: 'xh'
          },
          {
            title: '姓名',
            width: '80px',
            dataIndex: 'xm'
          },
          {
            title: '所属院系',
            width: '150px',
            dataIndex: 'ssyxmc'
          },
          {
            title: '所属专业',
            width: '150px',
            dataIndex: 'sszymc'
          },
          {
            title: '成绩',
            width: '100px',
            dataIndex: 'kscj'
          },
          {
            title: '备注',
            width: '70px',
            dataIndex: 'note'
          }
        ]
    }
  },
  methods: {
    onOk () {
     this.loading = true
     this.$emit('submitCheck',this.uploadList.length)
    }
  }
}
</script>

<style scoped lang="less">
</style>
